<%@ Control Language="C#" AutoEventWireup="true" CodeFile="SearchBook.ascx.cs" Inherits="SearchBook" %>

<div style="background:white;">

    <%--<form id="Form1" runat="server">--%>
    
        <%--Navigation Tabs--%>
        <ul id="navlist">
        <li> 
            <asp:Button ID="btnKeyword" runat="server" CssClass="selected" Text="Keyword" 
                onclick="btnKeyword_Click" CausesValidation="False" /></li>
        <li><asp:Button ID="btnTitle" runat="server" CssClass="notSelected" Text="Title" 
                onclick="btnTitle_Click" CausesValidation="False" /></li>
        <li><asp:Button ID="btnAuthor" runat="server" CssClass="notSelected" Text="Author" 
                onclick="btnAuthor_Click" CausesValidation="False" /></li>
        <li><asp:Button ID="btnSubject" runat="server" CssClass="notSelected" 
                Text="Subject" onclick="btnSubject_Click" CausesValidation="False" /></li>
        <li><asp:Button ID="btnISBN" runat="server" CssClass="notSelected" Text="ISBN" 
                onclick="btnISBN_Click" CausesValidation="False" /></li>
        </ul>
    
    <%--Keyword Search Panel--%>
    <asp:Panel ID="pnlkeyword" runat="server" CssClass="panel" DefaultButton="btnKeywordSubmit">
        <p>Type the keyword(s) in the box below then press Enter or click the Submit button.</p>

        <asp:TextBox ID="txtKeyword" runat="server" Height="30px" Width="200px" 
            ValidationGroup="keyword"></asp:TextBox>

        &nbsp;&nbsp;&nbsp;&nbsp;

        <asp:Button ID="btnKeywordSubmit" runat="server" Text="Submit" 
            onclick="btnKeywordSubmit_Click" ValidationGroup="keyword" />

        &nbsp;
        <asp:RequiredFieldValidator ID="vldKeyword" runat="server" 
            ControlToValidate="txtKeyword" ErrorMessage="Please enter a keyword" 
            ValidationGroup="keyword"></asp:RequiredFieldValidator>
        <p>
            Type the keywords you want to find. For example:
        </p>
        <asp:GridView ID="gvResultsByKeyword" runat="server" AllowPaging="True" 
            AutoGenerateColumns="False" DataKeyNames="Barcode" 
            onpageindexchanging="gvResultsByKeyword_PageIndexChanging" 
            onselectedindexchanged="gvResultsByKeyword_SelectedIndexChanged">
            <Columns>
                <asp:BoundField DataField="Title" HeaderText="Title" />
                <asp:BoundField DataField="Author" HeaderText="Author" />
                <asp:BoundField DataField="Name1" HeaderText="Location" />
                <asp:CommandField SelectText="View Details" ShowSelectButton="True" />
            </Columns>
        </asp:GridView>
        <asp:BulletedList ID="BulletedList1" runat="server">
            <asp:ListItem>Antique Quilts</asp:ListItem>
            <asp:ListItem>Costume Design</asp:ListItem>
        </asp:BulletedList>
        <%--<hr />--%>
        <asp:Label ID="lblTest" runat="server" Text=""></asp:Label>
        <br />
        <asp:Label ID="LblNoBooksKeyword" runat="server" Text="No results were found." 
            Visible="False"></asp:Label>
    </asp:Panel>
    
    <%--Title Search Panel--%>
    <asp:Panel ID="pnltitle" runat="server" CssClass="hide" DefaultButton="btnTitleSubmit">
       <p>Type the title you want to find, then press Enter or click the Submit button.</p>
        <%--<p>
            <br />--%>

        <asp:TextBox ID="txtTitle" runat="server" Height="30px" Width="200px" 
            ValidationGroup="title"></asp:TextBox>

        &nbsp;&nbsp;&nbsp;&nbsp;

        <asp:Button ID="btnTitleSubmit" runat="server" Text="Submit" 
            OnClick="btnTitleSubmit_Click" ValidationGroup="title" />
        <%--</p>--%>

        &nbsp;<asp:RequiredFieldValidator ID="vldTitle" runat="server" 
            ControlToValidate="txtTitle" 
            ErrorMessage="Please enter at least one word from the title" 
            ValidationGroup="title"></asp:RequiredFieldValidator>&nbsp;<p>
            Type as much or as little of the title as you want. For example:
        </p>
        <asp:BulletedList ID="BulletedList2" runat="server">
            <asp:ListItem>Quilting for Beginners</asp:ListItem>
            <asp:ListItem>Quilting for Be</asp:ListItem>
        </asp:BulletedList>
        <%--<hr />--%>
        <asp:GridView ID="gvResultsByTitle" runat="server" AutoGenerateColumns="False" 
            AllowPaging="True" DataKeyNames="Barcode"
            onpageindexchanging="gvResultsByTitle_PageIndexChanging" 
            OnSelectedIndexChanged="gvResultsByTitle_SelectedIndexChanged">
            <Columns>
                <asp:BoundField DataField="Title" HeaderText="Title" />
                <asp:BoundField DataField="Author" HeaderText="Author" />
                <asp:BoundField DataField="Name1" HeaderText="Location" />
                <asp:CommandField SelectText="View Details" ShowSelectButton="True" />
            </Columns>
        </asp:GridView>
        <br />
        <asp:Label ID="LblNoBooksTitle" runat="server" Text="No results were found." 
            Visible="False"></asp:Label>
    </asp:Panel>
    
    
    <asp:Panel ID="pnlauthor" runat="server" CssClass="hide" DefaultButton="btnAuthorSubmit">Type the author you want to 
        find, then press Enter or click the Submit button.<br />
        <asp:TextBox ID="txtAuthor" runat="server" Height="30px" Width="200px" 
            ValidationGroup="author"></asp:TextBox>
        &nbsp;&nbsp;
        <asp:Button ID="btnAuthorSubmit" runat="server" OnClick="btnAuthorSubmit_Click" 
            Text="Submit" ValidationGroup="author" />
        <%--</p>--%>&nbsp;
        <asp:RequiredFieldValidator ID="vldAuthor" runat="server" 
            ControlToValidate="txtAuthor" ErrorMessage="Please enter an author name" 
            ValidationGroup="author"></asp:RequiredFieldValidator>
        &nbsp;<p>
            Type the author you want to find. For example:
        </p>
        <asp:BulletedList ID="BulletedList3" runat="server">
            <asp:ListItem>Agatha Cristie</asp:ListItem>
            <asp:ListItem>Barak Obama</asp:ListItem>
        </asp:BulletedList>
        <%--<hr />--%>
        <asp:GridView ID="gvResultsByAuthor" runat="server" AutoGenerateColumns="False" 
            AllowPaging="True" DataKeyNames="Barcode"
            onpageindexchanging="gvResultsByAuthor_PageIndexChanging" 
            OnSelectedIndexChanged="gvResultsByAuthor_SelectedIndexChanged">
            <Columns>
                <asp:BoundField DataField="Title" HeaderText="Title" />
                <asp:BoundField DataField="Author" HeaderText="Author" />
                <asp:BoundField DataField="Name1" HeaderText="Location" />
                <asp:CommandField SelectText="View Details" ShowSelectButton="True" />
            </Columns>
        </asp:GridView>
        <br />
        <asp:Label ID="LblNoBooksAuthor" runat="server" Text="No results were found." 
            Visible="False"></asp:Label>
    </asp:Panel>
    <asp:Panel ID="pnlsubject" runat="server" CssClass="hide" DefaultButton="btnSubjectSubmit">Type the subject you want 
        to find, then press Enter or click the Submit button.<br />
        <asp:TextBox ID="txtSubject" runat="server" Height="30px" Width="200px" 
            ValidationGroup="subject"></asp:TextBox>
        &nbsp;&nbsp;
        <asp:Button ID="btnSubjectSubmit" runat="server" 
            OnClick="btnSubjectSubmit_Click" Text="Submit" ValidationGroup="subject" />
        <%--</p>--%>&nbsp;
        <asp:RequiredFieldValidator ID="vldSubject" runat="server" 
            ControlToValidate="txtSubject" ErrorMessage="Please enter a subject" 
            ValidationGroup="subject"></asp:RequiredFieldValidator>
        &nbsp;<p>
            Type the subject you want to find. For example:
        </p>
        <asp:BulletedList ID="BulletedList4" runat="server">
            <asp:ListItem>Pluto</asp:ListItem>
            <asp:ListItem>Mystery</asp:ListItem>
        </asp:BulletedList>
        <%--<hr />--%>
        <asp:GridView ID="gvResultsBySubject" runat="server" AllowPaging="True" 
            AutoGenerateColumns="False" DataKeyNames="Barcode"
            onpageindexchanging="gvResultsBySubject_PageIndexChanging" 
            OnSelectedIndexChanged="gvResultsBySubject_SelectedIndexChanged">
            <Columns>
                <asp:BoundField DataField="Title" HeaderText="Title" />
                <asp:BoundField DataField="Author" HeaderText="Author" />
                <asp:BoundField DataField="Name1" HeaderText="Location" />
                <asp:CommandField SelectText="View Details" ShowSelectButton="True" />
            </Columns>
        </asp:GridView>
        <asp:Label ID="LblNoBooksSubject" runat="server" Text="No results were found." 
            Visible="False"></asp:Label>
        <br />
        <br />
    </asp:Panel>
    <asp:Panel ID="pnlISBN" runat="server" CssClass="hide" DefaultButton="btnISBNSubmit">Type the ISBN you want to 
        find, then press Enter or click the Submit button.<br />
        <asp:TextBox ID="txtISBN" runat="server" Height="30px" Width="200px" 
            ValidationGroup="ISBN"></asp:TextBox>
        &nbsp;&nbsp;
        <asp:Button ID="btnISBNSubmit" runat="server" OnClick="btnISBNSubmit_Click" 
            Text="Submit" ValidationGroup="ISBN" />
        <%--</p>--%>&nbsp;
        <asp:RequiredFieldValidator ID="vldISBN" runat="server" 
            ControlToValidate="txtISBN" ErrorMessage="Please enter an ISBN" 
            ValidationGroup="ISBN"></asp:RequiredFieldValidator>
        &nbsp;<p>
            Type the ISBN you want to find without any punctuation. For example:
        </p>
        <asp:BulletedList ID="BulletedList5" runat="server">
            <asp:ListItem>555444555</asp:ListItem>
            <asp:ListItem>1112223334445</asp:ListItem>
        </asp:BulletedList>
        <%--<hr />--%>
        <asp:GridView ID="gvResultsByISBN" runat="server" AutoGenerateColumns="False" 
            AllowPaging="True" DataKeyNames="Barcode"
            onpageindexchanging="gvResultsByISBN_PageIndexChanging" 
            OnSelectedIndexChanged="gvResultsByISBN_SelectedIndexChanged">
            <Columns>
                <asp:BoundField DataField="Title" HeaderText="Title" />
                <asp:BoundField DataField="Author" HeaderText="Author" />
                <asp:BoundField DataField="Name1" HeaderText="Location" />
                <asp:CommandField SelectText="View Details" ShowSelectButton="True" />
            </Columns>
        </asp:GridView>
        <asp:Label ID="LblNoBooksISBN" runat="server" Text="No results were found." 
            Visible="False"></asp:Label>
    </asp:Panel>
    <%--</form>--%>
    
    <asp:Label ID="lblPatron" runat="server" Text="" Visible="false"></asp:Label>

    <br />
    <asp:Label ID="lblMessage" runat="server" ForeColor="Red"></asp:Label>
    <asp:Label ID="lblSuccess" runat="server" Text=""></asp:Label>
    <asp:GridView ID="gvReserveBookResults" runat="server">
    </asp:GridView>
</div>
<asp:Panel ID="pnlBookDetails" runat="server">       
    <asp:Button ID="btnCopyDetails" runat="server" CssClass="selected" Text="Status" 
                onclick="btnCopyDetails_Click" CausesValidation="False" />
    <asp:Button ID="btnMoreDetails" runat="server" CssClass="notSelected" Text="Details" 
                onclick="btnMoreDetails_Click" CausesValidation="False" />
<asp:Panel ID="pnlSimpleDetails" runat="server" style="margin-top: 0px" 
    Height="300px">
    <table title="SimpleDetails" class="style1" width="450">
        <tr>
            <td class="style11">
                Title</td>
            <td class="style3" colspan="2">
                <asp:Label ID="lblTitle" runat="server" Text=""></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="style11">
                Author</td>
            <td class="style3" colspan="2">
                <asp:Label ID="lblAuthor" runat="server" Text=""></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="style11">
                Publisher</td>
            <td class="style3" colspan="2">
                <asp:Label ID="lblPublisher" runat="server" Text=""></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="style11">
                &nbsp;</td>
            <td class="style9">
                &nbsp;</td>
            <td class="style10">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style11">
                <asp:Label ID="lblTCallNum" runat="server" Text="Call Number"></asp:Label>
            </td>
            <td class="style9">
                <asp:Label ID="lblTStatus" runat="server" Text="Status"></asp:Label>
            </td>
            <td class="style10">
                <asp:Label ID="lblTLocation" runat="server" Text="Location"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="style11">
                <asp:Label ID="lblCallNumber" runat="server" Text=""></asp:Label>
            </td>
            <td class="style9">
                <asp:Label ID="lblStatus" runat="server" Text=""></asp:Label>
            </td>
            <td class="style10">
                <asp:Label ID="lblLibrary" runat="server" Text=""></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="style11">
                &nbsp;</td>
            <td class="style9">
                &nbsp;</td>
            <td class="style10">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style11">
                &nbsp;</td>
            <td class="style9">
                <asp:ImageButton ID="ImageButton1" runat="server" CausesValidation="False" 
                    ImageUrl="~/gbs_preview_button1.gif" onclick="ImageButton1_Click" />
            </td>
            <td class="style10">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style11">
                &nbsp;</td>
            <td class="style9">
                &nbsp;</td>
            <td class="style10">
                &nbsp;</td>
        </tr>
    </table>
</asp:Panel>

<asp:Panel ID="pnlMoreDetails" runat="server" Height="300px">
    <table class="style1" width="450">
        <tr>
            <td>
                Series Title</td>
            <td>
                <asp:Label ID="lblSeriesTitle" runat="server" Text=""></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="style2">
                Subject</td>
            <td class="style2">
                <asp:Label ID="lblSubject" runat="server" Text=""></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                Keywords</td>
            <td>
                <asp:Label ID="lblKeywords" runat="server" Text=""></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                Date Published</td>
            <td>
                <asp:Label ID="lblDatePublished" runat="server" Text=""></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                Is Young Adult</td>
            <td>
                <asp:Label ID="lblIsYoungAdult" runat="server" Text=""></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                ISBN</td>
            <td>
                <asp:Label ID="lblISBN" runat="server" Text=""></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                Barcode</td>
            <td>
                <asp:Label ID="lblBarcode" runat="server" Text=""></asp:Label>
            </td>
        </tr>
    </table>
</asp:Panel>

<asp:Button ID="btnReturn" runat="server" Text="Close" 
    onclick="btnReturn_Click" />
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:Button ID="btnReserveBook" runat="server" Text="Reserve Book" 
        onclick="btnReserveBook_Click" />
</asp:Panel>

